'use strict'

class  aspiration{
  
  constructor () {

  }

  async list(c){
    let wuser = c.service.model.aspiration
    let ulist = await wuser.list()
    c.send(ulist)
  }

  //得到动态列表
  async get (c) {
    // console.log(c.query)
    let aspirationid=c.param.id
    let wuser = c.service.model.aspiration
    let ulist = await wuser.list(aspirationid)
    c.send(ulist)
  }

  async post(c){
    let data=JSON.parse(c.body)
    console.log(data)
    let wuser = c.service.model.aspiration
    await wuser.insert(data)
  }
  
}

module.exports = aspiration